package com.ly.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ly.dao.RoleMenuDao;
import com.ly.entity.Menu;
import com.ly.entity.RoleMenu;
import com.ly.rep.PageRequest;
import com.ly.service.RoleMenuService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class RoleMenuServiceImpl implements RoleMenuService {
    @Resource
    private RoleMenuDao roleMenuDao;
    @Override
    public PageInfo<RoleMenu> queryByPage(PageRequest<RoleMenu> pageRequest) {
        PageHelper.startPage(pageRequest.getPageNum(),pageRequest.getPageSize());
        List<RoleMenu> roleMenuList = roleMenuDao.selectAll(pageRequest.getQ());
        PageInfo<RoleMenu> roleMenuPageInfo = new PageInfo<>(roleMenuList);
        return roleMenuPageInfo;
    }
}
